/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.oracleandsxnd.erp.seting.entity;

import com.oracleandsxnd.erp.common.persistence.TreeEntity;
import org.hibernate.validator.constraints.Length;


/**
 * 地区设置Entity
 * @author 地区设置
 * @version 2019-12-17
 */
public class Area extends TreeEntity<Area> {
	
	private static final long serialVersionUID = 1L;
	private String code;		// 编码
	private String name;		// 名称
	private Area pid;		// pid
	
	public Area() {
		super();
	}

	public Area(String id){
		super(id);
	}

	@Override
	public Area getParent() {
		return pid;
	}

	@Override
	public void setParent(Area parent) {
	this.pid=parent;
	}

	@Length(min=0, max=10, message="编码长度必须介于 0 和 10 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=0, max=20, message="名称长度必须介于 0 和 20 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public Area getPid() {
		return pid;
	}

	public void setPid(Area pid) {
		this.pid = pid;
	}
	
}